﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// wx_PreOrder数据模型对象
    /// </summary>
    [Serializable]
    public partial class wx_PreOrderMod
    {
        /// <summary>
        /// 初始化wx_PreOrder数据模型对象
        /// </summary>
        public wx_PreOrderMod()
        {
            
        }
        /// <summary>
        /// 初始化wx_PreOrder数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="preID">PreID</param>
        /// <param name="iamount">iamount</param>
        /// <param name="ctime">ctime</param>
        /// <param name="openid">openid</param>
        /// <param name="refundState">RefundState</param>
        /// <param name="orderType">orderType</param>
        public wx_PreOrderMod(string preID,decimal iamount,DateTime ctime,string openid,int refundState,string orderType)
        {
            //给PreID字段赋值
            this.PreID = preID;
            //给iamount字段赋值
            this.Iamount = iamount;
            //给ctime字段赋值
            this.Ctime = ctime;
            //给openid字段赋值
            this.Openid = openid;
            //给RefundState字段赋值
            this.RefundState = refundState;
            //给orderType字段赋值
            this.OrderType = orderType;
        }
        /// <summary>
        /// 初始化wx_PreOrder数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="preID">PreID</param>
        /// <param name="goodsKey">goodsKey</param>
        /// <param name="iamount">iamount</param>
        /// <param name="ctime">ctime</param>
        /// <param name="ptime">ptime</param>
        /// <param name="bstate">bstate</param>
        /// <param name="openid">openid</param>
        /// <param name="wxOrder">wxOrder</param>
        /// <param name="trade_state">trade_state</param>
        /// <param name="trade_state_desc">trade_state_desc</param>
        /// <param name="refundState">RefundState</param>
        /// <param name="refundOrder">RefundOrder</param>
        /// <param name="refundDescription">RefundDescription</param>
        /// <param name="refundSendTime">RefundSendTime</param>
        /// <param name="refundRetTime">RefundRetTime</param>
        /// <param name="orderType">orderType</param>
        public wx_PreOrderMod(string preID,string goodsKey,decimal iamount,DateTime ctime,DateTime? ptime,int? bstate,string openid,string wxOrder,string trade_state,string trade_state_desc,int refundState,string refundOrder,string refundDescription,DateTime? refundSendTime,DateTime? refundRetTime,string orderType)
        {
            //给PreID字段赋值
            this.PreID = preID;
            //给goodsKey字段赋值
            this.GoodsKey = goodsKey;
            //给iamount字段赋值
            this.Iamount = iamount;
            //给ctime字段赋值
            this.Ctime = ctime;
            //给ptime字段赋值
            this.Ptime = ptime;
            //给bstate字段赋值
            this.Bstate = bstate;
            //给openid字段赋值
            this.Openid = openid;
            //给wxOrder字段赋值
            this.WxOrder = wxOrder;
            //给trade_state字段赋值
            this.Trade_state = trade_state;
            //给trade_state_desc字段赋值
            this.Trade_state_desc = trade_state_desc;
            //给RefundState字段赋值
            this.RefundState = refundState;
            //给RefundOrder字段赋值
            this.RefundOrder = refundOrder;
            //给RefundDescription字段赋值
            this.RefundDescription = refundDescription;
            //给RefundSendTime字段赋值
            this.RefundSendTime = refundSendTime;
            //给RefundRetTime字段赋值
            this.RefundRetTime = refundRetTime;
            //给orderType字段赋值
            this.OrderType = orderType;
        }
        
		//属性存储数据的变量
        private string _preID;
        private string _goodsKey;
        private decimal _iamount;
        private DateTime _ctime;
        private DateTime? _ptime;
        private int? _bstate;
        private string _openid;
        private string _wxOrder;
        private string _trade_state;
        private string _trade_state_desc;
        private int _refundState;
        private string _refundOrder;
        private string _refundDescription;
        private DateTime? _refundSendTime;
        private DateTime? _refundRetTime;
        private string _orderType;
        
        /// <summary>
        /// PreID
        /// </summary>
        public string PreID
        {
            get { return this._preID; }
            set { this._preID = value; }
        }
        /// <summary>
        /// goodsKey
        /// </summary>
        public string GoodsKey
        {
            get { return this._goodsKey; }
            set { this._goodsKey = value; }
        }
        /// <summary>
        /// iamount
        /// </summary>
        public decimal Iamount
        {
            get { return this._iamount; }
            set { this._iamount = value; }
        }
        /// <summary>
        /// ctime
        /// </summary>
        public DateTime Ctime
        {
            get { return this._ctime; }
            set { this._ctime = value; }
        }
        /// <summary>
        /// ptime
        /// </summary>
        public DateTime? Ptime
        {
            get { return this._ptime; }
            set { this._ptime = value; }
        }
        /// <summary>
        /// bstate
        /// </summary>
        public int? Bstate
        {
            get { return this._bstate; }
            set { this._bstate = value; }
        }
        /// <summary>
        /// openid
        /// </summary>
        public string Openid
        {
            get { return this._openid; }
            set { this._openid = value; }
        }
        /// <summary>
        /// wxOrder
        /// </summary>
        public string WxOrder
        {
            get { return this._wxOrder; }
            set { this._wxOrder = value; }
        }
        /// <summary>
        /// trade_state
        /// </summary>
        public string Trade_state
        {
            get { return this._trade_state; }
            set { this._trade_state = value; }
        }
        /// <summary>
        /// trade_state_desc
        /// </summary>
        public string Trade_state_desc
        {
            get { return this._trade_state_desc; }
            set { this._trade_state_desc = value; }
        }
        /// <summary>
        /// RefundState
        /// </summary>
        public int RefundState
        {
            get { return this._refundState; }
            set { this._refundState = value; }
        }
        /// <summary>
        /// RefundOrder
        /// </summary>
        public string RefundOrder
        {
            get { return this._refundOrder; }
            set { this._refundOrder = value; }
        }
        /// <summary>
        /// RefundDescription
        /// </summary>
        public string RefundDescription
        {
            get { return this._refundDescription; }
            set { this._refundDescription = value; }
        }
        /// <summary>
        /// RefundSendTime
        /// </summary>
        public DateTime? RefundSendTime
        {
            get { return this._refundSendTime; }
            set { this._refundSendTime = value; }
        }
        /// <summary>
        /// RefundRetTime
        /// </summary>
        public DateTime? RefundRetTime
        {
            get { return this._refundRetTime; }
            set { this._refundRetTime = value; }
        }
        /// <summary>
        /// orderType
        /// </summary>
        public string OrderType
        {
            get { return this._orderType; }
            set { this._orderType = value; }
        }
        
        /// <summary>
        /// 对比两个wx_PreOrder数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的wx_PreOrder数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成wx_PreOrder数据模型对象
            wx_PreOrderMod wx_PreOrderMod = obj as wx_PreOrderMod;
            //判断是否转换成功
            if (wx_PreOrderMod == null) return false;
            //进行匹配属性的值
            return
                //判断PreID是否一致
                this.PreID == wx_PreOrderMod.PreID &&
                //判断goodsKey是否一致
                this.GoodsKey == wx_PreOrderMod.GoodsKey &&
                //判断iamount是否一致
                this.Iamount == wx_PreOrderMod.Iamount &&
                //判断ctime是否一致
                this.Ctime == wx_PreOrderMod.Ctime &&
                //判断ptime是否一致
                this.Ptime == wx_PreOrderMod.Ptime &&
                //判断bstate是否一致
                this.Bstate == wx_PreOrderMod.Bstate &&
                //判断openid是否一致
                this.Openid == wx_PreOrderMod.Openid &&
                //判断wxOrder是否一致
                this.WxOrder == wx_PreOrderMod.WxOrder &&
                //判断trade_state是否一致
                this.Trade_state == wx_PreOrderMod.Trade_state &&
                //判断trade_state_desc是否一致
                this.Trade_state_desc == wx_PreOrderMod.Trade_state_desc &&
                //判断RefundState是否一致
                this.RefundState == wx_PreOrderMod.RefundState &&
                //判断RefundOrder是否一致
                this.RefundOrder == wx_PreOrderMod.RefundOrder &&
                //判断RefundDescription是否一致
                this.RefundDescription == wx_PreOrderMod.RefundDescription &&
                //判断RefundSendTime是否一致
                this.RefundSendTime == wx_PreOrderMod.RefundSendTime &&
                //判断RefundRetTime是否一致
                this.RefundRetTime == wx_PreOrderMod.RefundRetTime &&
                //判断orderType是否一致
                this.OrderType == wx_PreOrderMod.OrderType;
        }
        /// <summary>
        /// 将当前wx_PreOrder数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将wx_PreOrder数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将PreID进行按位异或运算处理
                (this.PreID == null ? 2147483647 : this.PreID.GetHashCode()) ^
                //将goodsKey进行按位异或运算处理
                (this.GoodsKey == null ? 2147483647 : this.GoodsKey.GetHashCode()) ^
                //将iamount进行按位异或运算处理
                this.Iamount.GetHashCode() ^
                //将ctime进行按位异或运算处理
                this.Ctime.GetHashCode() ^
                //将ptime进行按位异或运算处理
                (this.Ptime == null ? 2147483647 : this.Ptime.GetHashCode()) ^
                //将bstate进行按位异或运算处理
                (this.Bstate == null ? 2147483647 : this.Bstate.GetHashCode()) ^
                //将openid进行按位异或运算处理
                (this.Openid == null ? 2147483647 : this.Openid.GetHashCode()) ^
                //将wxOrder进行按位异或运算处理
                (this.WxOrder == null ? 2147483647 : this.WxOrder.GetHashCode()) ^
                //将trade_state进行按位异或运算处理
                (this.Trade_state == null ? 2147483647 : this.Trade_state.GetHashCode()) ^
                //将trade_state_desc进行按位异或运算处理
                (this.Trade_state_desc == null ? 2147483647 : this.Trade_state_desc.GetHashCode()) ^
                //将RefundState进行按位异或运算处理
                this.RefundState.GetHashCode() ^
                //将RefundOrder进行按位异或运算处理
                (this.RefundOrder == null ? 2147483647 : this.RefundOrder.GetHashCode()) ^
                //将RefundDescription进行按位异或运算处理
                (this.RefundDescription == null ? 2147483647 : this.RefundDescription.GetHashCode()) ^
                //将RefundSendTime进行按位异或运算处理
                (this.RefundSendTime == null ? 2147483647 : this.RefundSendTime.GetHashCode()) ^
                //将RefundRetTime进行按位异或运算处理
                (this.RefundRetTime == null ? 2147483647 : this.RefundRetTime.GetHashCode()) ^
                //将orderType进行按位异或运算处理
                (this.OrderType == null ? 2147483647 : this.OrderType.GetHashCode());
        }
        /// <summary>
        /// 将当前wx_PreOrder数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前wx_PreOrder数据模型对象转换成字符串副本
            return
                "[" +
                //将PreID转换成字符串
                this.PreID + "," +
                //将iamount转换成字符串
                this.Iamount + "," +
                //将ctime转换成字符串
                this.Ctime + "," +
                //将openid转换成字符串
                this.Openid + "," +
                //将RefundState转换成字符串
                this.RefundState + "," +
                //将orderType转换成字符串
                this.OrderType +
                "]";
        }
    }
}
